var Commonaj = {
    //错误弹窗
    error: function (msg, obj) {
        layer.tips(msg, obj, {
            tips: [2, '#d9534f']
        });
    },
    wrong: function (message) {
        layer.msg(message, {time: 500}, function (index) {
            layer.close(index);
        });
    },
    //成功弹窗
    success: function (message, url) {
        layer.msg(message, {time: 500}, function (index) {
            layer.close(index);
            window.location.href = url;
        });
    },
    del: function (id,url,gotoUrl) {
        layer.confirm('确认删除这货吗？', {
            btn: ['删除','取消'] //按钮
        }, function(){
            $.post(url,{id:id},function(data){
                if(data.state > 0){
                    Commonaj.wrong(data.msg);
                }else{
                    Commonaj.success(data.msg,gotoUrl);
                }
            });
        });
    },
}